﻿using System.Text.RegularExpressions;

namespace StockholmsStad.Windows.UI.Infrastructure.ValidationRules
{
    public class EmailAddressValidationRule
    {
        public static bool IsValidEmail(string emailAddress)
        {
            const string emailPattern = @"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}";

            var emailRegex = new Regex(emailPattern);

            return emailRegex.IsMatch(emailAddress);
        }
    }
}
